<!-- 测试组件 -->
<template>
  <div>
      <!-- <h2>测试组件</h2>
      <h3>m_color:{{m_color}}</h3>
      <h3>m_filter:{{0.222222|toTow}}</h3>
      <h3 >pageTitile:{{pageTitile}} <button @click="sePageTitle('标题')">改变标题</button></h3>
      <h3>isBack:{{isBack}} <button @click="setIsBack('0')">改变isBack</button></h3>

       <h3> <button @click="login()">发送请求</button></h3> -->
  </div>
</template>

<script>
import * as api from '../api/index.js'
import { mapActions, mapState,mapMutations,mapGetters } from 'vuex'
export default {
  data () {
    return {
    }
  },
  methods:{
    login(){
      api.login({}).then(res=>{
        console.log(res)
      })
    }
    //  ...mapActions(['setPageTitle','setIsBack']), 
  },
  computed: {
    ...mapGetters(['pageTitile','isBack'])  
  },
  watch:{
    pageTitile:{
    handler(newName, oldName) {
      console.log(newName,1);
    },
    immediate: true, //是否 监听初始值
    deep: true , //是否监听整个对象变化
    }
  }
}

</script>
<style lang='scss' scoped>
button{
    height: 1rem;
    width: 2rem;;
    border: 0.01rem solid #eee;
   
}
.bor{
     border: 0.01rem solid #eee;
     background: #fff;
}
</style>